package com.zxh.zhenxihuan.mapper;

import com.zxh.zhenxihuan.entity.z.OrderForm;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface OrderFormMapper {
    /**
     * 获得总数
     */
    @Select(" select count(1) from order_form ")
    Integer getSum();
    /**
     * 查询列表
     */
    @Select(" select * from order_form limit #{page},#{count}")
    List<OrderForm> getOrderForm(@Param("page") Integer page, @Param("count") Integer count);
    /**
     * 删除用户
     */
    @Delete(" delete from order_form where id= #{id} ")
    Integer del(Integer id);
    /**
     * 添加
     */
    @Insert(" insert into order_form ( a_refund_of_time, clear_time, merchant_code, status," +
            " order_time, receiving_time, time_payment, total_prices, chat_code, address, shop_code)\n" +
            "         values ( #{a_refund_of_time} , #{clear_time} , #{merchant_code} ,\n" +
            "         #{status} , #{order_time} , #{receiving_time} , #{time_payment} , " +
            " #{total_prices} , #{chat_code} , #{address} , #{shop_code} )")
    Long add(OrderForm orderForm);
    /**
     * 修改
     */
    @Update(" update order_form set a_refund_of_time = #{a_refund_of_time} , " +
            " status = #{status} , " +
            " receiving_time = #{receiving_time} , time_payment = #{time_payment} ," +
            " total_prices = #{total_prices} " +
            " address = #{address} , where id = #{id} ")
    Long update(OrderForm orderForm);

}

